﻿using System;
using Beaker.OpenCube.Render.Maths;
using System.Diagnostics.Contracts;
using Beaker.OpenCube.Render.Tracing;

namespace Beaker.OpenCube.Render.Cameras
{
	public interface ICamera
	{
		[Pure]
		Point3 Position { get; }
		[Pure]
		Point3 LookAt { get; }

		[Pure]
		Vector3 U { get; }
		[Pure]
		Vector3 V { get; }
		[Pure]
		Vector3 W { get; }

		/// <summary>
		/// Render the given scene onto the given view-plane using this camera
		/// </summary>
		/// <param name="scene">The scene to render</param>
		/// <param name="viewPlane">The view-plane to render to.</param>
		/// <param name="tracer">The tracer to use for tracing rays.</param>
		/// <returns>An observable that sends render updates while rendering</returns>
		IObservable<IRenderUpdate> Render( Scene scene, ViewPlane viewPlane, ITracer tracer );
	}
}
